require("../../@babel/runtime/helpers/Arrayincludes"), (global.webpackJsonp = global.webpackJsonp || []).push([ [ "components/login-button/index" ], {
    "43d3": function(e, n, t) {
        t.r(n);
        var o = t("c2c8"), i = t("59cd");
        for (var a in i) [ "default" ].indexOf(a) < 0 && function(e) {
            t.d(n, e, function() {
                return i[e];
            });
        }(a);
        t("7fe4");
        var r = t("f0c5"), c = Object(r.a)(i.default, o.b, o.c, !1, null, "32a263f0", null, !1, o.a, void 0);
        n.default = c.exports;
    },
    4535: function(e, n, t) {},
    "59cd": function(e, n, t) {
        t.r(n);
        var o = t("b0f1"), i = t.n(o);
        for (var a in o) [ "default" ].indexOf(a) < 0 && function(e) {
            t.d(n, e, function() {
                return o[e];
            });
        }(a);
        n.default = i.a;
    },
    "7fe4": function(e, n, t) {
        var o = t("4535");
        t.n(o).a;
    },
    b0f1: function(e, n, t) {
        (function(e) {
            var o = t("4ea4").default;
            Object.defineProperty(n, "__esModule", {
                value: !0
            }), n.default = void 0;
            var i = o(t("a34a")), a = o(t("278c")), r = o(t("c973")), c = o(t("ded3")), l = t("26cb"), u = t("6c67"), d = t("3094"), s = t("6c0e"), f = {
                name: "LoginButton",
                props: {
                    customStyle: String,
                    disabled: Boolean,
                    canLogin: {
                        type: Boolean,
                        default: !0
                    },
                    enableClick: {
                        type: Boolean,
                        default: !1
                    }
                },
                computed: (0, c.default)((0, c.default)((0, c.default)({}, (0, l.mapGetters)([ "isLogined" ])), (0, 
                l.mapState)([ "coupeConfig" ])), {}, {
                    loginFallBackWeChat: function() {
                        var e;
                        return (null === (e = this.coupeConfig) || void 0 === e ? void 0 : e.loginFallBackWeChat) || !1;
                    },
                    loginFallBackAliPay: function() {
                        var e;
                        return (null === (e = this.coupeConfig) || void 0 === e ? void 0 : e.loginFallBackAliPay) || !1;
                    },
                    openType: function() {
                        return !this.isLogined && this.canLogin && !this.loginFallBackWeChat ? "getPhoneNumber" : "";
                    }
                }),
                created: function() {
                    this.isLogined || this.getWxCode();
                },
                methods: {
                    getWxCode: function() {
                        var n = this;
                        return (0, r.default)(i.default.mark(function t() {
                            var o, r, c, l, u;
                            return i.default.wrap(function(t) {
                                for (;;) switch (t.prev = t.next) {
                                  case 0:
                                    return t.next = 2, e.login();

                                  case 2:
                                    o = t.sent, r = (0, a.default)(o, 2), c = r[0], l = r[1], u = void 0 === l ? {} : l, 
                                    c ? n.$error({
                                        title: c.errMsg || ""
                                    }) : n.wxCode = u.code;

                                  case 8:
                                  case "end":
                                    return t.stop();
                                }
                            }, t);
                        }))();
                    },
                    handleClick: function() {
                        !this.isLogined && this.loginFallBackWeChat && this.$emit("loginFail"), (this.isLogined || this.enableClick) && this.$emit("click");
                    },
                    getWxPhone: function(e) {
                        var n = this;
                        return (0, r.default)(i.default.mark(function t() {
                            var o, a, r, c, l, u;
                            return i.default.wrap(function(t) {
                                for (;;) switch (t.prev = t.next) {
                                  case 0:
                                    if (o = (e || {}).detail, r = (a = o || {}).encryptedData, c = a.iv, l = (null == o ? void 0 : o.errMsg) || (null == o ? void 0 : o.message) || (null == o ? void 0 : o.errorMessage) || "", 
                                    ![ "user cancel", "user deny", "用户取消授权" ].some(function(e) {
                                        return l.includes(e);
                                    })) {
                                        t.next = 7;
                                        break;
                                    }
                                    return n.$dialog({
                                        content: "你已拒绝授权，请重新点击并授权",
                                        confirmText: "确定"
                                    }), t.abrupt("return");

                                  case 7:
                                    if (u = (0, s.watchdogPercent)(s.WatchdogPercent.authorizationLoginEvent), r && c) {
                                        t.next = 13;
                                        break;
                                    }
                                    return u.fail({
                                        msg: l,
                                        errno: (null == o ? void 0 : o.errno) || (null == o ? void 0 : o.errCode) || (null == o ? void 0 : o.code) || (null == o ? void 0 : o.error) || -1
                                    }), n.$error({
                                        title: "授权失败，请使用验证码登录"
                                    }), n.$emit("loginFail"), t.abrupt("return");

                                  case 13:
                                    n.$statistics("login", {
                                        button_type: "同意"
                                    }), n.requestLogin(o), u.success();

                                  case 16:
                                  case "end":
                                    return t.stop();
                                }
                            }, t);
                        }))();
                    },
                    requestLogin: function() {
                        var e = arguments, n = this;
                        return (0, r.default)(i.default.mark(function t() {
                            var o;
                            return i.default.wrap(function(t) {
                                for (;;) switch (t.prev = t.next) {
                                  case 0:
                                    o = e.length > 0 && void 0 !== e[0] ? e[0] : {}, n.$loading(), (0, u.fastLogin)({
                                        code: n.wxCode,
                                        encrypted_data: o.encryptedData,
                                        iv: o.iv,
                                        activity_login_code: 0,
                                        login_type: 0
                                    }).then(function(e) {
                                        n.$loading.hide(), 0 === Number(e.ret) ? ((0, d.successHandle)(e.data, 1), n.$emit("loginSuccess"), 
                                        n.$socket.init()) : (n.getWxCode(), n.$toast({
                                            title: e.msg
                                        }));
                                    }).catch(function(e) {
                                        n.getWxCode(), n.$loading.hide(), n.$error({
                                            title: "获取手机号失败"
                                        });
                                    });

                                  case 3:
                                  case "end":
                                    return t.stop();
                                }
                            }, t);
                        }))();
                    }
                }
            };
            n.default = f;
        }).call(this, t("543d").default);
    },
    c2c8: function(e, n, t) {
        t.d(n, "b", function() {
            return o;
        }), t.d(n, "c", function() {
            return i;
        }), t.d(n, "a", function() {});
        var o = function() {
            this.$createElement;
            this._self._c;
        }, i = [];
    }
} ]), (global.webpackJsonp = global.webpackJsonp || []).push([ "components/login-button/index-create-component", {
    "components/login-button/index-create-component": function(e, n, t) {
        t("543d").createComponent(t("43d3"));
    }
}, [ [ "components/login-button/index-create-component" ] ] ]);